

	*First bring in the original data from T&L
use "datasets/Tavits_Letki_APSR.dta", clear

replace countryname="Macedonia" if countryname=="Macedonia, FYR"
replace countryname="Slovakia" if countryname=="Slovak Republic"

***merge with new data on l-r adjusted for time bias 
sort countryname year
merge countryname year using "datasets/adjusted_mcss300.dta"
drop _merge
sort countryname year


*merge with the general measure of left-right as used in T&L
merge countryname year using "datasets/tl_measure.dta"
drop _merge
sort countryname year

*merge with the measurement based on labels
merge countryname year using "datasets/labels_ideology.dta"
drop _merge


encode countryname, gen(country_num)

**FIRST THE REGULAR MEASURE EMPLOYED BY T&L
xtpcse diff_total lag_total_exp fdi year_dem balance unemployment inflation gdp_growth openness dependency lr_tavits number_parties ///
dum1 dum4 dum5 dum6 dum7 dum9 dum10 dum11 dum12 dum13 dum14 dum15 
xtpcse diff_health lag_health fdi year_dem balance unemployment inflation gdp_growth openness dependency lr_tavits number_parties ///
dum1 dum4 dum5 dum6 dum7 dum9 dum10 dum11 dum12 dum13 dum14 dum15 
xtpcse diff_edu lag_edu fdi year_dem balance unemployment inflation gdp_growth openness pop18 number_parties lr_tavits ///
dum1 dum4 dum5 dum6 dum7 dum9 dum10 dum11 dum12 dum13 dum14 dum15 


*SECOND THE FIRST MCSS ADJUSTED MEASURE WITH THE PARTY THAT WINS POPULAR VOTE
*THESE ARE THE RESULTS REPORTED IN THE PAPER

xtpcse diff_total lag_total_exp fdi year_dem balance unemployment inflation gdp_growth openness dependency lr_300 number_parties ///
dum1 dum4 dum5 dum6 dum7 dum9 dum10 dum11 dum12 dum13 dum14 dum15
xtpcse diff_health lag_health fdi year_dem balance unemployment inflation gdp_growth openness dependency lr_300 number_parties ///
dum1 dum4 dum5 dum6 dum7 dum9 dum10 dum11 dum12 dum13 dum14 dum15 
xtpcse diff_edu lag_edu fdi year_dem balance unemployment inflation gdp_growth openness pop18 number_parties lr_300 ///
dum1 dum4 dum5 dum6 dum7 dum9 dum10 dum11 dum12 dum13 dum14 dum15 



*FOURTH A LABEL BASED MEASURE;
xtpcse diff_total lag_total_exp fdi year_dem balance unemployment inflation gdp_growth openness dependency lr_label number_parties ///
dum1 dum4 dum5 dum6 dum7 dum9 dum10 dum11 dum12 dum13 dum14 dum15
xtpcse diff_health lag_health fdi year_dem balance unemployment inflation gdp_growth openness dependency lr_label number_parties ///
dum1 dum4 dum5 dum6 dum7 dum9 dum10 dum11 dum12 dum13 dum14 dum15 
xtpcse diff_edu lag_edu fdi year_dem balance unemployment inflation gdp_growth openness pop18 number_parties lr_label ///
dum1 dum4 dum5 dum6 dum7 dum9 dum10 dum11 dum12 dum13 dum14 dum15 


****TESTS REPORTED IN THE APPENDIX
	*1) TESTS WITH NO COUNTRY OR YEAR FIXED EFFECTS, TABLE A4
	
	*Regular measure employed by T&L
xtpcse diff_total lag_total_exp fdi year_dem balance unemployment inflation gdp_growth openness dependency lr_tavits number_parties 

xtpcse diff_health lag_health fdi year_dem balance unemployment inflation gdp_growth openness dependency lr_tavits number_parties 

xtpcse diff_edu lag_edu fdi year_dem balance unemployment inflation gdp_growth openness pop18 lr_tavits number_parties

	*The measure adjusted for time bias
	
xtpcse diff_total lag_total_exp fdi year_dem balance unemployment inflation gdp_growth openness dependency lr_300 number_parties 

xtpcse diff_health lag_health fdi year_dem balance unemployment inflation gdp_growth openness dependency lr_300 number_parties 

xtpcse diff_edu lag_edu fdi year_dem balance unemployment inflation gdp_growth openness pop18 number_parties lr_300 


	*The label-based measure
xtpcse diff_total lag_total_exp fdi year_dem balance unemployment inflation gdp_growth openness dependency lr_label number_parties 

xtpcse diff_health lag_health fdi year_dem balance unemployment inflation gdp_growth openness dependency lr_label number_parties 

xtpcse diff_edu lag_edu fdi year_dem balance unemployment inflation gdp_growth openness pop18 number_parties lr_label 

	*2) TESTS WITH BOTH COUNTRY AND YEAR FIXED EFFECTS, TABLE A5
	
xtpcse diff_total lag_total_exp fdi year_dem balance unemployment inflation gdp_growth openness dependency lr_tavits number_parties ///
dum1 dum4 dum5 dum6 dum7 dum9 dum10 dum11 dum12 dum13 dum14 dum15 i.year
xtpcse diff_health lag_health fdi year_dem balance unemployment inflation gdp_growth openness dependency lr_tavits number_parties ///
dum1 dum4 dum5 dum6 dum7 dum9 dum10 dum11 dum12 dum13 dum14 dum15 i.year
xtpcse diff_edu lag_edu fdi year_dem balance unemployment inflation gdp_growth openness pop18 number_parties lr_tavits ///
dum1 dum4 dum5 dum6 dum7 dum9 dum10 dum11 dum12 dum13 dum14 dum15 i.year

